<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //将多个参数的函数转换为接受一个参数的函数
        // function sum(a, b)
        // {
        //     return a + b;
        // }

        // function sum(a) {
        //     return function (b) {
        //         return a + b;
        //     }
        // }
        const sum = a => b => a + b
        sum(1)(2)
        console.log(sum(10)(2))
    </script>
</body>

</html>